<%@ page import="project.entity.User" %>
<%@ page import="java.util.List" %>
<%@ page import="project.entity.Student" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
欢迎您：${user.userName}<br/>
<a href="gradeController">新增学生</a>
<table border="1">
    <tr>
        <th>学生编号</th>
        <th>学生姓名</th>
        <th>学生性别</th>
        <th>手机号码</th>
        <th>出生日期</th>
        <th>学生邮箱</th>
        <th>家庭地址</th>
        <th>班级编号</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${studentList}" var="student">
        <tr>
            <td>${student.stuId}</td>
            <td>${student.stuName}</td>
            <td>${student.stuGender}</td>
            <td>${student.stuPhone}</td>
            <td>${student.bornDate}</td>
            <c:if test="${empty student.stuEmail}">
                <td>暂无</td>
            </c:if>
            <c:if test="${!(empty student.stuEmail)}">
                <td>${student.stuEmail}</td>
            </c:if>

            <td>${student.stuAddress}</td>
            <td>${student.gradeId}</td>
            <td><a href="selectStudent?stuId=${student.stuId}">修改</a><a href="delete?stuId=${student.stuId}">删除</a></td>
        </tr>

    </c:forEach>
    <tr>
        <td colspan="9" align="center">
            <a href="showAllStudentController?pageIndex=1">首页</a>
            <c:if test="${page.pageIndex>1}">
                <a href="showAllStudentController?pageIndex=${page.pageIndex-1}">上一页</a>
            </c:if>
            <c:if test="${page.pageIndex<page.totalPage}">
                <a href="showAllStudentController?pageIndex=${page.pageIndex+1}">下一页</a>
            </c:if>
            <a href="showAllStudentController?pageIndex=${page.totalPage}">尾页</a>
        </td>
    </tr>

</table>
</body>
</html>
